#include<iostream>
using namespace std;
const int N = 110, M = 2e5 + 10, B = M / 2;
int n, m;
int w[N];
bool f[N][M];
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> w[i];
		m += w[i];
	}
	f[0][0+B] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = -m; j <= m; j++) {
			f[i][j + B] = f[i - 1][j + B];
			if (j - w[i] >= -m) {
				f[i][j + B] |= f[i - 1][j - w[i] + B];
			}
			if (j + w[i] <= m) {
				f[i][j + B] |= f[i - 1][j + w[i] + B];
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= m; i++) {
		if (f[n][i + B])ans++;
	}
	cout << ans << endl;
	return 0;
}
